find_package(Qt4)

if (NOT QT_FOUND)
	message (WARNING "Qt4 not found. The sub-project is skipped")
	return ()
endif()

SET(prog_SOURCES main.cpp dialog.cpp)
SET(prog_HEADERS dialog.h)
SET(prog_RESOURCES dialog.qrc)

QT4_WRAP_CPP(prog_HEADERS_MOC ${prog_HEADERS})
QT4_WRAP_UI(prog_FORMS_HEADERS dialog.ui)
QT4_ADD_RESOURCES(prog_RESOURCES_RCC ${prog_RESOURCES})

INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})

ADD_EXECUTABLE(how-to-hor-layout-in-qt ${prog_SOURCES} ${prog_HEADERS}
	${prog_HEADERS_MOC}
	${prog_FORMS_HEADERS} 
	${prog_RESOURCES_RCC})
TARGET_LINK_LIBRARIES(how-to-hor-layout-in-qt ${QT_LIBRARIES})

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

source_group("Generated Files" FILES ${prog_FORMS_HEADERS} ${prog_HEADERS_MOC} ${prog_RESOURCES_RCC})
